import request from '@/utils/request'

// 新增
export function save(data) {
  return request({
    url: '/account/save',
    method: 'post',
    data
  })
}
// 编辑
export function update(data) {
  return request({
    url: '/account/update',
    method: 'post',
    data
  })
}
// 删除
export function del(data) {
  return request({
    url: '/account/delete',
    method: 'post',
    data
  })
}
// 获取列表
export function findList(companyId) {
  return request({
    url: '/account/findAllByCompanyId',
    method: 'get',
    params: { companyId }
  })
}
// 根据id获取实体类
export function findById(accountId) {
  return request({
    url: '/account/findById',
    method: 'get',
    params: { accountId }
  })
}
// 公司下所有账户余额，流出，流入总计
export function findcount(companyId) {
  return request({
    url: '/account/count',
    method: 'get',
    params: { companyId }
  })
}
// 账户间转账
export function transfer(data) {
  return request({
    url: '/account/transfer',
    method: 'post',
    data
  })
}
